package gui.data.D2;

import gui.MyFrame;

import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class PointsIn2DOutputGui extends JPanel {

	JTextField x1i, x2i, y1i, y2i, vectori, disti;
	MyFrame myFrame;
	JLabel x1l, x2l, y1l, y2l, vectorl, distl;

	public PointsIn2DOutputGui(double x1, double y1, double x2, double y2, double distance, String vector) {
		this.setLayout(new GridLayout(7, 2));
		this.setPreferredSize(new Dimension(500, 500));
		
		x1l = new JLabel("X1 = ");
		x2l = new JLabel("X2 = ");
		y1l = new JLabel("Y1 = ");
		y2l = new JLabel("Y2 = ");
		distl = new JLabel("Distance = ");
		vectorl = new JLabel("Vector = ");
		
		x1i = new JTextField(x1 == 0 ? "N/A":""+x1);
		x2i = new JTextField(x2 == 0 ? "N/A":""+x2);
		y1i = new JTextField(y1 == 0 ? "N/A":""+y1);
		y2i = new JTextField(y2 == 0 ? "N/A":""+y2);
		disti = new JTextField(distance == 0 ? "N/A":""+distance);
		vectori = new JTextField(vector.equals("") ? "N/A":vector);
		
		x1i.setEditable(false);
		x2i.setEditable(false);
		y1i.setEditable(false);
		y2i.setEditable(false);
		disti.setEditable(false);
		vectori.setEditable(false);
		
		this.add(x1l);
		this.add(x1i);
		this.add(y1l);
		this.add(y1i);
		this.add(x2l);
		this.add(x2i);
		this.add(y2l);
		this.add(y2i);
		this.add(distl);
		this.add(disti);
		this.add(vectorl);
		this.add(vectori);
		this.add(new JLabel(""));
	}
}
